package pricingTag;

/*
 * the reply of a deal
 * 1)if the replying store has no such product, has_product = false
 * 2)if the replying store accepts such deal, accept = true
 * 3)if the replying store refuse such deal, then the reply include a asked bonus;
 * 
 */
public class Reply {
	Store from_store;
	boolean accept = false;
	double asked_bonus = -1;
	boolean has_product = true;
	Deal deal;

	public Reply(Store from_store, Deal deal) {
		this.from_store = from_store;
		this.deal = deal;
		deal.count++;
		// TODO Auto-generated constructor stub

	}

	public Reply(Store from_store, Deal deal, double asked_bonus) {
		this.from_store = from_store;
		this.deal = deal;
		this.asked_bonus = asked_bonus;
		deal.count++;
		// TODO Auto-generated constructor stub
		this.show();

	}

	void show() {
		System.out.println("****************************");
		System.out.format("Reply from %s to %s \nAbout \"%s\" status= %b \n",
				from_store, deal.from_store, deal.product_name, accept);
		if (has_product && !accept) {
			System.out.println("Asked bonus " + asked_bonus
					+ " given bonus is " + deal.bonus);
		}
		// System.out.println("s");
		System.out.println("****************************");

	}
}
